package com.yaoayao.mall.order.client;

import com.yaoayao.mall.model.order.OrderInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

/**
 * @author: peiyao
 * @date: 2024/4/18 2:18
 * @description:
 */
@FeignClient(name = "service-order")
public interface OrderFeignClient {
    @GetMapping("/api/order/trade")
    public Map<String,Object> trade();

    //根据订单ID 查询订单对象
    @GetMapping("/api/order/getOrderInfo/{orderId}")
    public OrderInfo getOrderInfo(@PathVariable Long orderId);

    /**
     * 提交秒杀订单
     * @param orderInfo
     * @return
     */
    @PostMapping("/api/order/seckill/submitOrder")
    Long submitOrder(@RequestBody OrderInfo orderInfo);
}
